/***********************************************************************
    filename:   DaterCommon.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines Common operations for objects in UI
*************************************************************************/
#ifndef _DaterCommon_h_
#define _DaterCommon_h_

#include "cegui.h"
#include "DaterTime.h"
#include <string>

/* !
	\brief
		Translate from MBCS to UTF8.
		
	\param pMbcs
		- origin code MBCS.
*/
CEGUI::utf8* mbcs_to_utf8(const char* pMbcs);

/* !
	\brief
		Translate from UTF8 to MBCS.
		
	\param g_buf
		- origin code UTF8.
*/
char* utf8_to_mbcs(const CEGUI::utf8* g_buf);

/* !
	\brief
		Transform from class Time to string.
		
	\param time
		- an object of origin type Time.
*/
std::string timeToString(Dater::Time time);

/* !
	\brief
		Transform from class string to Time.
		
	\param str
		- an object of origin type string.
*/
Dater::Time stringToTime(std::string str);

/* !
	\brief
		get a random number between start and end.
		
	\param start
		- the lower bound of random number.
		
	\param end
		- the upper bound of random number.
*/
double random(double start, double end);

#endif